package com.dingding.service.account.core.dao.impl;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.dingding.common.core.base.dao.impl.BaseDaoImpl;
import com.dingding.common.core.base.daox.ICriteriaBaseDao;
import com.dingding.common.core.beans.Useraccountdetail;
import com.dingding.common.core.beans.special.Specialaccounttradedetail;
import com.dingding.service.account.core.dao.IUserAccountDetailDao;

/**
 * 
 * @ClassName: UserAccountDetailDaoImpl 
 * @Description: 用户账户（叮币）交易明细表DAO
 * 用户账户变动记录
 * @author CHEHAUNBO 
 * @date 2016年3月30日 下午4:19:58
 * 
 */
@Component("userAccountDetailDao")
public class UserAccountDetailDaoImpl extends BaseDaoImpl<Useraccountdetail> implements IUserAccountDetailDao {

	private Logger log = Logger.getLogger(UserAccountDetailDaoImpl.class);

	@Resource(name = "criteriaBaseDao")
	private ICriteriaBaseDao criteriaBaseDao;

	/**
	 * 
	 * @Description: 添加交易明细
	 * @author CHEHUANBO
	 * @return void
	 * @since v2.3.0
	 * 
	 */
	@Override
	public void addAccountDetail(Useraccountdetail useraccountdetail) {

		try {
			super.save(useraccountdetail);
		} catch (Exception e) {
			log.error("保存交易明细出现异常！", e);
		}

	}

	/**
	 * 
	 * @Title: addSpecialAccountDetail 
	 * @Description: 添加专车司机端交易明细
	 * @param specialaccounttradedetail 
	 * @author CHEHAUNBO
	 * 
	 */
	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public void addSpecialAccountDetail(Specialaccounttradedetail specialaccounttradedetail) {

		try {
			criteriaBaseDao.save(specialaccounttradedetail);
		} catch (Exception e) {
			log.error("添加专车司机端交易明细时出现异常   类：" + this.getClass() + " addSpecialAccountDetail()", e);
		}

	}

}
